package com.github.chirspan.xaas.auth.listener;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.ApplicationListener;
import org.springframework.security.authentication.event.AuthenticationFailureBadCredentialsEvent;
import org.springframework.stereotype.Component;

/**
 * @className: AuthenticationSuccessEventListener
 * @description: <p></p>
 * @author: chenpan
 * @date: 2021/6/18 10:29
 **/
@Component
@Slf4j
public class AuthenticationFailureListener implements ApplicationListener<AuthenticationFailureBadCredentialsEvent> {

    @Override
    public void onApplicationEvent(AuthenticationFailureBadCredentialsEvent event) {
        log.debug("密码错误");
        // todo 登录日志及密码错误次数
    }
}
